<template>
  <div>
    <div>hello {{ msg }}</div>
    <p>开启状态: {{ visible ? '开启' : '关闭' }}</p>
  </div>
</template>

<script setup>
import { ref, watch } from 'vue';
const msg = ref('test');

const visible = ref(true)

const emits = defineEmits(['close'])

setTimeout(() => {
    emits('close')
    visible.value = false
}, 3000);
</script>
